package com.hxq.demo.adapter.obj;

import com.hxq.demo.adapter.SDCard;
import com.hxq.demo.adapter.TFCard;

//创建适配器对象（SD兼容TF）
public class SDAdapterTFForObj implements SDCard {

    private TFCard tfCard;

    public SDAdapterTFForObj(TFCard tfCard) {
        this.tfCard = tfCard;
    }

    public String readSD() {
        System.out.println("adapter read tf card ");
        return tfCard.readTF();
    }

    public void writeSD(String msg) {
        System.out.println("adapter write tf card");
        tfCard.writeTF(msg);
    }
}
